package com.gaattc.service;

import com.gaattc.dao.UserDao;
import com.gaattc.dao.UserDaoImpl;
import com.gaattc.model.User;
import com.gaattc.model.bo.AdminLoginBO;
import com.gaattc.model.bo.UserChangePwdBO;

import java.util.List;

public class UserServiceImpl implements UserService {

    private UserDao userDao = new UserDaoImpl();

    @Override
    public List<User> allUser() {
        return userDao.allUser();
    }

    @Override
    public int deleteUser(int id) {
        return userDao.deleteUser(id);
    }

    @Override
    public List<User> searchUser(String word) {
        return userDao.searchUser(word);
    }

    @Override
    public int login(AdminLoginBO loginBO) {
        return userDao.login(loginBO);
    }

    @Override
    public int signUp(User user) {
        return userDao.signUp(user);
    }

    @Override
    public User data(String token) {
        return userDao.data(token);
    }

    @Override
    public int updatePwd(UserChangePwdBO userChangePwdBO) {
        return userDao.updatePwd(userChangePwdBO);
    }

    @Override
    public void updateUserData(User user) {
        userDao.updateUserData(user);
    }
}
